﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Security.Application;

namespace MWPF.Utilities.DataCleansing
{
    public class DataCleansingUtils
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="text"></param>
        /// <param name="encodeType"></param>
        /// <returns></returns>
        public static string Encode(string text, EncodeType encodeType)
        {
            EncodeType type = encodeType;

            switch(type)
            {
                case EncodeType.HTML:
                    return Microsoft.Security.Application.Encoder.HtmlEncode(text);
                case EncodeType.Url:
                    return Microsoft.Security.Application.Encoder.UrlEncode(text);
            }

            return String.Empty;
        }

        public enum EncodeType
        {
            HTML,
            Url
        };
    }
}
